package cn.yusei.teamTribe.util;

import com.google.gson.Gson;

public class JsonUtil {

	private static Gson gson = new Gson();
	
	public static String getJsonString(Object jsonObject)
	{
		return gson.toJson(jsonObject);
	}
	
	public static <T> T getJsonObject(String jsonString, Class<T> cla)
	{
		T jsonObject = null;
		try
		{
			jsonObject = gson.fromJson(jsonString, cla);
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		return jsonObject;
	}
	
}
